package tools;

import org.junit.jupiter.api.Test;

/**
 * <h2>StringTools</h2>
 * <p>Description</p>
 * <p>CreatedAt: 2020-01-18 14:37</p>
 * <p><a href="mailto:forever2y_y@163.com">SendMailToMe</a></p>
 *
 * @author llh
 */
public class StringTools {

    @Test
    public void test01() {
        String text = "[2, 7, 11, 15]";
        String replace = text.replace("[", "").replace("]", "");
        String[] split = replace.split(",");
        int[] nums = new int[split.length];
        for (int i = 0; i < split.length; i++) {
            nums[i] = Integer.parseInt(split[i]);
        }
        System.out.println(replace);
    }
}
